<?=$this->load->view('include_header',null)?>
	<div id="top-panel">
		<div id="panel">
			<ul>
				<li class="current"><a href="<?=site_url('archive/idcard/'.$id)?>" class="report"><?=(empty($id))?"录入新":"编辑"?>客户基本信息</a></li>
				<?php if(!empty($info->id)):?><li><a id="printInfo" class="folder_table">打印本页信息</a></li><?php endif;?>
			</ul>
		</div>
	</div>
	<div id="wrapper">
		<div id="content">
			<div id="box">
<!-- table begin -->
<form method="post" id="form"  enctype="multipart/form-data" action="<?=site_url('schengen/bo_update/'.$cateid)?>">

	<h3>玻利维亚申请表</h3>
    <table width="100%">
    <thead>
        <tr>
          <td colspan="4" align="right"><img src="<?= (@$info->avatar)?@$info->avatar:'images/avatar.gif'?>" width="150" height="150" /></td>
		  <td align="right">
		  上传照片<br />
		  <input type="file" name="userphoto" /><br />
		  (.gif|.jpg|.png文件,最大1M)<br />
		  <?php if (@$info->attachment):?><a href="<?= @$info->attachment?>" target="_blank">点击下载附件</a><?php endif; ?>
		  &nbsp;&nbsp;&nbsp;&nbsp;上传附件<br />
		  <input type="file" name="userfile" /><br />
		  (.pdf|.zip|.rar|.doc,最大2M)		  
		  </td>
        </tr>
    </thead>
    <tfoot>
        <tr>
            <td colspan="5" align="right">			
			<input type="hidden" name="id" value="<?=$id?>" />
			<input id="button1" type="submit" value="提交信息" />
			<input id="button2" type="reset" value="重置" />
			</td>
        </tr>
    </tfoot>

    <tbody>
	
	
	<tr class="odd">
            <td colspan="5" align="center">NOTA: No está permitido el cambio de status migratorio en Bolivia<br />
  NOTE: It is not allowed to change migratory status while in Bolivia
 注意：在玻利维亚期间不准更换移居地
</td>
        </tr>
		<tr class="even">
            <td colspan="5">TIPO DE VISA REQUERIDA/TYPE OF VISA REQUESTED/签证类型<br />
 <input type="radio" name="visa_type" value="1" <?= (@$info->visa_type==1)?'checked':''?>/> TURISTA/TOURIST  /旅游 &nbsp;&nbsp; 
 <input type="radio" name="visa_type" value="2" <?= (@$info->visa_type==2)?'checked':''?>/> OBJETO DETERMINADO/SPECIFIC PURPOSE /商务<br />
 <input type="radio" name="visa_type" value="3" <?= (@$info->visa_type==3)?'checked':''?>/> ESTUDIANTE/STUDENT/学生 &nbsp;&nbsp;
 <input type="radio" name="visa_type" value="4" <?= (@$info->visa_type==4)?'checked':''?>/> EN TRANSITO/ TRANSIT/中转 <br />
			</td>
        </tr>
		 <tr class="odd">
		 <td colspan="5">1.</td>
		 </tr>
		 <tr class="even">
		 <td>Apellidos/Surnames/姓</td>
            <td><input type="text" name="surname" value="<?= @$info->surname?>" /></td>
            <td>&nbsp;</td>
            <td>Primer nombre/First name/名 </td>
            <td><input type="text" name="firstname" value="<?= @$info->firstname?>" /></td>
		 </tr>
        <tr class="odd">
            <td>Segundo nombre/Middle name/
其它姓名</td>
            <td><input type="text" name="former" value="<?= @$info->former?>" /></td>
            <td>&nbsp;</td>
            <td>Lugar y fecha de nacimiento/Place and date of birth/出生地点及日期 </td>
            <td>Place<input type="text" name="birth_place" value="<?= @$info->birth_place?>" /><br />
			Date of birth<select name="birth_d"><?php for($i=1;$i<=31;$i++) echo "<option value='$i'".((@$info->birth_d==$i)?"selected":"").">$i</option>"; ?></select> - 
			<select name="birth_m"><?php for($i=1;$i<=12;$i++) echo "<option value='$i'".((@$info->birth_m==$i)?"selected":"").">$i</option>"; ?></select> - 
			<select name="birth_y"><?php for($i=date("Y");$i>1940;$i--) echo "<option value='$i'".((@$info->birth_y==$i)?"selected":"").">$i</option>"; ?></select></td>
        </tr>
        <tr class="even">
           <td>Nacionalidad/Nationality/国籍</td>
            <td><input type="text" name="nationality" value="<?= @$info->nationality?>" /></td>
            <td>&nbsp;</td>
            <td>(Opcional) Carnet de identidad/ (Optional)National  Identification Number/身份证号码 </td>
            <td><input type="text" name="national_id" value="<?= @$info->national_id?>" /></td>
        </tr>
        <tr class="odd">
            <td>Ocupación actual/Present occupation/工作</td>
            <td><input type="text" name="occupation" value="<?= @$info->occupation?>" /></td>
            <td>&nbsp;</td>
            <td>Estado civil/Marital status/婚姻状况 </td>
            <td>
<input type="radio" name="marital_status" value="1" <?= (@$info->marital_status==1)?'checked':''?>/> Casado(a)/Married/已婚<br />			
<input type="radio" name="marital_status" value="2" <?= (@$info->marital_status==2)?'checked':''?>/> Soltero(a)/Single/未婚<br />
<input type="radio" name="marital_status" value="3" <?= (@$info->marital_status==3)?'checked':''?>/> Viudo(a)/ Widowed/丧偶<br />
<input type="radio" name="marital_status" value="4" <?= (@$info->marital_status==4)?'checked':''?>/> Separado/Separated/分居<br /> 
<input type="radio" name="marital_status" value="5" <?= (@$info->marital_status==5)?'checked':''?>/> Divorciado(a)/Divorced/离婚</td>
        </tr>
        <tr class="even">
            <td colspan="2">Clase y número de pasaporte/Passport type and number/护照类型及号码<br />
			<input type="text" name="travel_document_num" value="<?= @$info->travel_document_num?>" /><br />
			Lugar de emisión/Place of issuance/护照签发地<input type="text" name="travel_document_issue_by" value="<?= @$info->travel_document_issue_by?>" style="width:300px"/><br />
			Ciudad/City/城市<input type="text" name="travel_document_issue_city" value="<?= @$info->travel_document_issue_city?>" /><br />
			País/Country/国家<input type="text" name="travel_document_issue_country" value="<?= @$info->travel_document_issue_country?>" />
			</td>
            <td>&nbsp;</td>
            <td colspan="2">Fecha de emisión/Issuing date/<br />签发日期<input type="text" name="travel_document_issue_date" value="<?= @$info->travel_document_issue_date?>" id="travel_document_issue_date" /><br />
			Fecha de expiración/Expiration date<br />截止日期<input type="text" name="travel_document_valid_date" value="<?= @$info->travel_document_valid_date?>" id="travel_document_valid_date" /><br /></td>
        </tr>
        <tr class="odd">
            <td colspan="5">Teléfono de su residencia/Home phone number/家里电话<input type="text" name="home_tel" value="<?= @$info->home_tel?>" /><br />
			Teléfono donde trabaja/Work phone number/工作电话<input type="text" name="office_tel" value="<?= @$info->office_tel?>" /><br />
			Teléfono Celular/Mobile/手机<input type="text" name="mobile" value="<?= @$info->mobile?>" /><br />
			Buscapersona/Beeper number/BP机<input type="text" name="bp" value="<?= @$info->bp?>" /><br />
			Dirección electrónica/Email address/邮箱<input type="text" name="email" value="<?= @$info->email?>" id="email" />
			
			</td>
        </tr>
        <tr class="even">
          <td colspan="5">Solicitó visa anteriormente?/Have you applied before for a visa? /之前是否申请过签证   &nbsp;&nbsp;
		  <input type="radio" name="has_applied" value="1" <?= (@$info->has_applied==1)?'checked':''?>/> Si/Yes /是
&nbsp;&nbsp;<input type="radio" name="has_applied" value="0" <?= (@$info->has_applied==0)?'checked':''?>/> No/否<br />
Dónde/Where/何地	 <input type="text" name="applied_where" value="<?= @$info->applied_where?>" />&nbsp;&nbsp;&nbsp;Fecha/Date/日期 <input type="text" name="applied_when" value="<?= @$info->applied_when?>" id="applied_when" />
			  </td>
        </tr>
        <tr class="odd">
            <td colspan="2">Cuánto tiempo desea permanecer en Bolivia?/How long do you intend to stay in Bolivia?/打算在玻利维亚停留多久？</td>
			<td>&nbsp;</td>
            <td colspan="2"><input type="text" name="stay_days" value="<?= @$info->stay_days?>" style="width:300px"/></td>
        </tr>
        <tr class="even">
            <td colspan="2">Qué lugar le gustaría visitar?/Which place would you like to visit?/打算去玻利维亚的哪些地方?</td>
           <td>&nbsp;</td>
            <td colspan="2"><input type="text" name="stay_place" value="<?= @$info->stay_place?>" style="width:300px"/></td>
        </tr>
        <tr class="odd">
            <td colspan="5">Tiene familiares en Bolivia?/Do you have relatives in Bolivia?/是否有亲属在玻利维亚？&nbsp;&nbsp;<input type="radio" name="has_relatives" value="1" <?= (@$info->has_relatives==1)?'checked':''?>/> Si/Yes /是
&nbsp;&nbsp;<input type="radio" name="has_relatives" value="0" <?= (@$info->has_relatives==0)?'checked':''?>/> No/否<br />
Nombre completo/Full name/全名<input type="text" name="relatives_name" value="<?= @$info->relatives_name?>" /><br />
Dirección/ address/地址<input type="text" name="relatives_address" value="<?= @$info->relatives_address?>" style="width:300px"/><br />
Ciudad/City/所在城市<input type="text" name="relatives_city" value="<?= @$info->relatives_city?>" /><br />
Teléfono/Telephone/电话<input type="text" name="relatives_tel" value="<?= @$info->relatives_tel?>" /></td>
            </td>
        </tr>
        <tr class="even">
            <td colspan="5" align="center">(Opcional) Persona(s) de contacto en caso de emergencia/(Optional) In case of emergency, contact/紧急情况下联系方式：</td>
        </tr>
		        <tr class="odd">
            <td colspan="2">
			2. Nombre completo/Full name/全称<input type="text" name="contact_name" value="<?= @$info->contact_name?>" /><br />
			Fecha de nacimiento/Date of birth/出生日期<input type="text" name="contact_birth" value="<?= @$info->contact_birth?>" id="contact_birth" /><br />
			Dirección donde vive/Home address/家庭地址<input type="text" name="contact_address" value="<?= @$info->contact_address?>"  style="width:300px"/><br />
			Calle/Street address/街道地址<input type="text" name="contact_street" value="<?= @$info->contact_street?>" /><br />
			Estado o Departamento/State or Province/省份<input type="text" name="contact_province" value="<?= @$info->contact_province?>" /><br />
			 Código Postal/Postal Code邮编<input type="text" name="contact_postal" value="<?= @$info->contact_postal?>" /><br />
			País/Country:/国家<input type="text" name="contact_country" value="<?= @$info->contact_country?>" /></td>
			<td>&nbsp;</td>
			<td colspan="2">
			Dirección donde trabaja/Work address/工作地址<input type="text" name="work_address" value="<?= @$info->work_address?>" style="width:300px"/><br />
			Calle/Street address/街道地址<input type="text" name="work_street" value="<?= @$info->work_street?>" /><br />
			Ciudad/City/城市<input type="text" name="work_city" value="<?= @$info->work_city?>" /><br />
			Estado o Departamento/State or Province/省份<input type="text" name="work_province" value="<?= @$info->work_province?>" /><br />
			Código Postal/Postal Code/邮编<input type="text" name="work_postal" value="<?= @$info->work_postal?>" /><br />
			País/Country/国家<input type="text" name="work_country" value="<?= @$info->work_country?>" /><br />
			Teléfono/Telephone number/电话<input type="text" name="work_tel" value="<?= @$info->work_tel?>" /></td>
        </tr>
        <tr class="even">
            <td colspan="2">3. Medio de Transporte/ Transportation/yu 运输方式<br />
 <input type="radio" name="transportation" value="1" <?= (@$info->transportation==1)?'checked':''?>/> Aéreo/Plane/飞机&nbsp;&nbsp;&nbsp;&nbsp;
 <input type="radio" name="transportation" value="2" <?= (@$info->transportation==2)?'checked':''?>/> Train/火车<br />
 <input type="radio" name="transportation" value="3" <?= (@$info->transportation==3)?'checked':''?>/> Terrestre/Bus/汽车&nbsp;&nbsp;&nbsp;
 <input type="radio" name="transportation" value="4" <?= (@$info->transportation==4)?'checked':''?>/> Others/其他 </td>
            <td>&nbsp;</td>
            <td colspan="2">Ruta/Route/路径<input type="text" name="route" value="<?= @$info->route?>" style="width:300px"/><br />
			Fecha de Retorno/Date of return/归程日期<input type="text" name="depart_date" value="<?= @$info->depart_date?>" id="depart_date" /></td>
        </tr>		
        <tr class="odd">
            <td>Lugar de presentación de la    solicitud/ Place of application/申请地<br />
			<input type="text" name="app_place" value="<?= @$info->app_place?>" /></td>
			<td>Día/Day/日<input type="text" name="app_d" value="<?= @$info->app_d?>" /></td>
			<td>&nbsp;</td>
			<td>Mes/Month/月<input type="text" name="app_m" value="<?= @$info->app_m?>" /></td>
			<td>Año/Year/年<input type="text" name="app_y" value="<?= @$info->app_y?>" /></td>
        </tr>
        <tr class="even"> 
            <td colspan="5">&nbsp;</td>
        </tr>
       
    </tbody>
	</table>
<!-- table end -->
</form>

			</div>
		</div>
		
		<?=$this->load->view('include_sidebar',array('id'=>$id,'forms'=>$forms))?>
	</div>

<script type="text/javascript">
$().ready(function() {
  $("#form").validate({
    rules: {
		surname:"required",
		firstname:"required",
		nationality:"required",
		national_id:"required",
		marital_status:"required",
		travel_document_num:"required",
		travel_document_issue_by:"required",
		travel_document_issue_date:"required",
		travel_document_valid_date:"required",
		transportation:"required"
    }
  });
  
	$.datepicker.setDefaults(
		{
		dateFormat: 'dd/mm/yy',
		changeMonth: true,
		changeYear: true,
		showOn: "both",
		buttonImage: "images/calendar.gif",
		buttonImageOnly: true
		}
	);
	
	$("#travel_document_issue_date").datepicker();
	$("#travel_document_valid_date").datepicker();
	$("#contact_birth").datepicker();
	$("#depart_date").datepicker();
	
	$("#email").autoMail();

	$("#printInfo").click(function(o) {
		var prints = [
			{rel_id: <?=$cateid?>, rec_id: <?=$id?>}
		]  ;
		
		var jdata = JSON.stringify(prints);
		//alert(jdata);
		$.post("<?=site_url('proxy/does/'.str_replace('==','',base64_encode('http://'.$_SERVER['SERVER_NAME'].':9090/javaprduct/servlet/test')))?>",{clients:jdata},function(msg){alert(msg)});
	});
	
	$("#printInfo").ajaxError(function(event,request, settings){
		//$(this).append("<li>出错页面:" + settings.url + "</li>");
		alert("无法访问"+ settings.url );
	}); 
 
});
</script>

<?=$this->load->view('include_footer',null)?>